<script setup lang="ts">
import ReservationRecordBody from "@/apps/client/components/ReservationRecordBody.vue";
import InstrumentReservationRecordHead from "@/apps/client/components/InstrumentReservationRecordHead.vue";

import {makeStatus} from "@/apps/client/utils/recordStatusUtil"
// 定义 emit 事件
const emit = defineEmits<{
  (event: 'cancel'): void;
}>();

const props = defineProps<{ data: object }>()

const status = makeStatus(props.data)


// 处理取消预约
function handleCancelReservation() {
  emit('cancel');
}
</script>

<template>
  <van-cell-group inset>
    <InstrumentReservationRecordHead :data="props.data" :statusText="status"/>
    <ReservationRecordBody :data="props.data" @cancel="handleCancelReservation"/>
  </van-cell-group>

</template>

<style scoped>

</style>